package com.ljyanimo.utils;

import com.ljyanimo.entity.SysUser;
import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Component;

/**
 * Shiro工具类
 * @author Animo
 * @Date 2020/10/16
 * @Blog http://www.ljyanimo.com
 */
@Component
public class ShiroUtils {

    public SysUser getSysUser(){
        return (SysUser)SecurityUtils.getSubject().getPrincipal();
    }

    public Integer getUserId(){
        return getSysUser().getId();
    }

}
